<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/layout.css" />
        <link rel="stylesheet" type="text/css" href="../css/footer.css" />
    </head>
    <body>
        <script language="javascript">
            var $ = function(v) { return document.getElementById(v); } 
            /******************************************************验证用户输入******************************************************/ 
            function ValidateInput(element, value) { 
                //验证密码 
                if (element == "password") { 
                    if (value.toString().length < 6) { 
                        $('tipPosition').className = 'error'; 
                        $('tipPosition').innerHTML = "密码长度过小。"; 
                        return; 
                    } 
                    else { 
                        $('tipPosition').className = 'success'; 
                        $('tipPosition').innerHTML = "填写正确。"; 
                    } 
                } 
            } 

            function InitCss() { 
                $('tipPosition').className = 'tip'; 
                $('tipPosition').innerHTML = "6~16位。"; 
            } 

            function Evaluate(word) { 
                return word.replace(/^(?:([a-z])|([A-Z])|([0-9])|(.)){5,}|(.)+$/g, "$1$2$3$4$5").length; 
            } 
            function validatePwdStrong(value) { 
                var pwd = { 
                    color: ['#E6EAED', '#AC0035', '#FFCC33', '#639BCC', '#246626'], 
                    text: ['太短', '弱', '一般', '很好', '极佳'] 
                }; 
                function colorInit() { 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[0]; 
                    $('pwdStrong_2').style.backgroundColor = pwd.color[0]; 
                    $('pwdStrong_3').style.backgroundColor = pwd.color[0]; 
                    $('pwdStrong_4').style.backgroundColor = pwd.color[0]; 
                } 
                if (Evaluate(value) == 1) { 
                    colorInit(); 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[1]; 
                    $('pwdStrong_text').innerHTML = pwd.text[1]; 
                    $('pwdStrong_text').style.color = pwd.color[1]; 
                } 
                else if (Evaluate(value) == 2) { 
                    colorInit(); 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[2]; 
                    $('pwdStrong_2').style.backgroundColor = pwd.color[2]; 
                    $('pwdStrong_text').innerHTML = pwd.text[2]; 
                    $('pwdStrong_text').style.color = pwd.color[2]; 
                } 
                else if (Evaluate(value) == 3) { 
                    colorInit(); 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[3]; 
                    $('pwdStrong_2').style.backgroundColor = pwd.color[3]; 
                    $('pwdStrong_3').style.backgroundColor = pwd.color[3]; 
                    $('pwdStrong_text').innerHTML = pwd.text[3]; 
                    $('pwdStrong_text').style.color = pwd.color[3]; 
                } 
                else if (Evaluate(value) == 4) { 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[4]; 
                    $('pwdStrong_2').style.backgroundColor = pwd.color[4]; 
                    $('pwdStrong_3').style.backgroundColor = pwd.color[4]; 
                    $('pwdStrong_4').style.backgroundColor = pwd.color[4]; 
                    $('pwdStrong_text').innerHTML = pwd.text[4]; 
                    $('pwdStrong_text').style.color = pwd.color[4]; 
                } 
            } 
            function checkaccount(account){
             

                if(account==($('enter_name').value)){
                    $('account').className = 'error';
                    $('account').innerHTML="与企业名冲突"
                }else{
                     $('account').className = 'success';
                    $('account').innerHTML="账号正确"
                }
            }
            function checkemail(emails) 
            { 
               
               if(chekeNum(emails)==false) 
                { 
                   $('email').className = 'error'; 
                  $('email').innerHTML="邮箱地址不正确"
                   
                }else{
                    $('email').className = 'success'; 
                     $('email').innerHTML="邮箱地址正确"
                } 
            }
                function chekeNum(email)
                {
                 
                    var pattern = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;
                    if(pattern.test(email))
                    {
                        return true;
                    }
                    else
                    { 
                        return false;
                    }
                }
                function send_table2()
                {
                    var txtTRLastIndex = findObj("txtTRLastIndex",document);
                    var rowID = parseInt(txtTRLastIndex.value);
                    var all_data=new Array();
                    var all_td=new Array();
              
         
                    all_td=document.getElementById("SignFrame").getElementsByTagName("td");
                    for(var i=0;i<all_td.length;i++){
                        var list=all_td[i].getElementsByTagName("input");
                        for(var j=0;j<list.length;j++){
                            all_data.push(list[j].value);
                        }
                    }
              
                    document.form1.action="do_add_Enterprise.action";
                    document.submit();
                };
              
                function findObj(theObj, theDoc){  
                    var p, i, foundObj;
                    if(!theDoc) theDoc = document;  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)  {    theDoc = parent.frames[theObj.substring(p+1)].document;    theObj = theObj.substring(0,p);  }  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];  for (i=0; !foundObj && i < theDoc.forms.length; i++)     foundObj = theDoc.forms[i][theObj];  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)     foundObj = findObj(theObj,theDoc.layers[i].document);  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);    return foundObj;}
                //添加一个参与人填写行
                function AddSignRow(){ //读取最后一行的行号，存放在txtTRLastIndex文本框中 
                    var txtTRLastIndex = findObj("txtTRLastIndex",document);
                    var rowID = parseInt(txtTRLastIndex.value);

                    var signFrame = findObj("SignFrame",document);
                    //添加行
                    var newTR = signFrame.insertRow(signFrame.rows.length);
                    newTR.id = "SignItem" + rowID;

                    //添加列:序号
                    var newNameTD=newTR.insertCell(0);
                    //添加列内容
                    newNameTD.innerHTML = newTR.rowIndex.toString();

                    //添加列:姓名
                    var newNameTD=newTR.insertCell(1);
                    //添加列内容
                    newNameTD.innerHTML = "<input name='recordListDTO.time["+rowID+"]' id='time"+rowID + "' type='text' size='12' onfocus='Init()' onblur='checkdate()'/><div id='date'></div>";

                    //添加列:电子邮箱
                    var newEmailTD=newTR.insertCell(2);
                    //添加列内容
                    newEmailTD.innerHTML = "<input name='recordListDTO.amount["+rowID+"]' id='amount" + rowID + "' type='text' size='20' />";

                    //添加列:删除按钮
                    var newDeleteTD=newTR.insertCell(3);
                    //添加列内容
                    newDeleteTD.innerHTML = "<div align='center' style='width:40px'><a href='javascript:;' onclick=\"DeleteSignRow('SignItem" + rowID + "')\">删除</a></div>";

                    //将行号推进下一行
                    txtTRLastIndex.value = (rowID + 1).toString() ;
                }
                //删除指定行
                function DeleteSignRow(rowid){
                    var signFrame = findObj("SignFrame",document);
                    var signItem = findObj(rowid,document);

                    //获取将要删除的行的Index
                    var rowIndex = signItem.rowIndex;

                    //删除指定Index的行
                    signFrame.deleteRow(rowIndex);
             
                    //重新排列序号，如果没有序号，这一步省略
                    for(i=rowIndex;i<signFrame.rows.length;i++){
                        signFrame.rows[i].cells[0].innerHTML = i.toString();
                    }
                }//清空列表
                function ClearAllSign(){
                    if(confirm('确定要清空所有参与人吗？')){
                        var signFrame = findObj("SignFrame",document);
                        var rowscount = signFrame.rows.length;

                        //循环删除行,从最后一行往前删除
                        for(i=rowscount - 1;i > 0; i--){
                            signFrame.deleteRow(i);
                        }

                        //重置最后行号为1
                        var txtTRLastIndex = findObj("txtTRLastIndex",document);
                        txtTRLastIndex.value = "1";

                        //预添加一行
                        AddSignRow();
                    }
                }
        </script>
         <div ID="container">
            <div ID="header">
                <div ID="logo">
                </div>
                <div class="nav"> </div>
                <div id="menu">
                    <ul>
                        <li><a href="#">首页</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">财务</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">社会环境</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">警告预警</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">客户</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">报表审核</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">设置</a>
                    </ul>	
                </div>	
            </div>
            <div class="nav"> </div>
            <div ID="main">
                <form  name="form1" action="do_add_Enterprise" method="get" >
                    <div class="leftbox">
                        <div class="left">
                        </div>
                        <div class="select">
                            <select name="type.type" >
                                <s:iterator var="list" value="typeList">
                                    <option  selected="selected"><s:property value="#list.type"/>
                                    </option>
                                </s:iterator>
                            </select>

                        </div>
                    </div>
                    <div class="rightbox">
                   
                    </div>
          

                </form>
            </div>

        </div>
    </body>
</html>
